import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import Layout from '@/pages/system/menu/index.vue';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/login',
        name: 'Login',
        meta: {
            title: '登录',
            keepAlive: true,
            requireAuth: false,
        },
        component: () => import('@/pages/system/login/index.vue'),
    },
    {
        path: '/',
        name: 'FrontPage',
        meta: {
            title: '首页',
            keepAlive: true,
            requireAuth: true,
        },
        component: () => import('@/pages/frontPage/index.vue'),
    },
    {
        path: '/recommend',
        component: Layout,
        hidden: true,
        children: [
            {
                path: '/findMusic',
                name: 'PagesRecommendFindMusicIndex',
                meta: {
                    title: '发现音乐',
                    keepAlive: true,
                    requireAuth: true,
                },
                component: () => import('@/pages/recommend/findMusic/index.vue'),
            },
            {
                path: '/singer',
                name: 'PagesRecommendSingerIndex',
                meta: {
                    title: '我是歌手',
                    keepAlive: true,
                    requireAuth: true,
                },
                component: () => import('@/pages/recommend/singer/index.vue'),
            },
        ],
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});
export default router;
